cmake_minimum_required(VERSION 3.16)

project(qflightinstruments VERSION 1.0 LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)



find_package(QT NAMES Qt6 COMPONENTS Widgets SvgWidgets REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets SvgWidgets REQUIRED)
#FIX QT6 Link BUG in msys2 Qt static
if (QT_FEATURE_static STREQUAL "ON" AND WIN32 AND MINGW)
	set_property(TARGET harfbuzz::harfbuzz PROPERTY
		IMPORTED_IMPLIB ${harfbuzz_DIR}../../../libharfbuzz.dll.a )
endif()
message(${PROJECT_SOURCE_DIR})
include_directories(${PROJECT_SOURCE_DIR}/src)
include_directories(${PROJECT_SOURCE_DIR}/src/example)
set(PRJ_HEADERS
	src/qfi_ADI.h
	src/qfi_ALT.h
	src/qfi_ASI.h
	src/qfi_HSI.h
	src/qfi_NAV.h
	src/qfi_PFD.h
	src/qfi_TC.h
	src/qfi_VSI.h
	src/example/LayoutSquare.h
	src/example/MainWindow.h
	src/example/WidgetADI.h
	src/example/WidgetALT.h
	src/example/WidgetASI.h
	src/example/WidgetHSI.h
	src/example/WidgetNAV.h
	src/example/WidgetPFD.h
	src/example/WidgetSix.h
	src/example/WidgetTC.h
	src/example/WidgetVSI.h
	
)

set(PRJ_SOURCES
	src/qfi_ADI.cpp
	src/qfi_ALT.cpp
	src/qfi_ASI.cpp
	src/qfi_HSI.cpp
	src/qfi_NAV.cpp
	src/qfi_PFD.cpp
	src/qfi_TC.cpp
	src/qfi_VSI.cpp
	src/example/LayoutSquare.cpp
	src/example/main.cpp
	src/example/MainWindow.cpp
	src/example/WidgetADI.cpp
	src/example/WidgetALT.cpp
	src/example/WidgetASI.cpp
	src/example/WidgetHSI.cpp
	src/example/WidgetNAV.cpp
	src/example/WidgetPFD.cpp
	src/example/WidgetSix.cpp
	src/example/WidgetTC.cpp
	src/example/WidgetVSI.cpp

)

set (PRJ_FORMS
	src/example/MainWindow.ui
	src/example/WidgetADI.ui
	src/example/WidgetALT.ui
	src/example/WidgetASI.ui
	src/example/WidgetHSI.ui
	src/example/WidgetNAV.ui
	src/example/WidgetPFD.ui
	src/example/WidgetSix.ui
	src/example/WidgetTC.ui
	src/example/WidgetVSI.ui
)

set (PRJ_RES
	src/qfi.qrc
)
# ========================Exe========================

add_executable(qflightinstruments
	${PRJ_HEADERS}
	${PRJ_SOURCES}
	${PRJ_FORMS}
	${PRJ_RES}
)

target_link_libraries(qflightinstruments PRIVATE
	Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::SvgWidgets
)


